import java.util.*;

//牛客 找到字符串中的最长数字子串
class Solution3 {
    /*//我的方法
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            StringBuilder[] arr = new StringBuilder[500];
            int k = 0;
            String str = in.nextLine();
            for(int i = 0; i < str.length(); i++) {
                StringBuilder stringBuilder = new StringBuilder();
                if(str.charAt(i) >= '0' && str.charAt(i) <= '9') {
                    i = mainF(i, str, stringBuilder, arr, k);
                    arr[k] = stringBuilder;
                    k++;
                    if(i == str.length() - 1) {
                        break;
                    }
                }
            }
            int max = arr[0].length();
            int maxIndex = 0;
            for(int i = 1; i < arr.length; i++) {
                if(arr[i] != null && arr[i].length() > max) {
                    max = arr[i].length();
                    maxIndex = i;
                }
            }
            System.out.println(arr[maxIndex]);
        }
    }
    private static int mainF(int i, String str, StringBuilder stringBuilder, StringBuilder[] arr, int k) {
        int j = 0;
        for(j = i; j < str.length(); j++) {
            if(str.charAt(j) < '0' || str.charAt(j) > '9') {
                break;
            }
            if(str.charAt(j) >= '0' && str.charAt(j) <= '9') {
                stringBuilder.append(str.charAt(j));
            }
        }
        return j - 1;
    }*/




    //其它方法
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String string = in.nextLine();
            StringBuilder cur = new StringBuilder();
            StringBuilder ret = new StringBuilder();
            int i = 0;
            for (; i < string.length(); i++) {
                char ch = string.charAt(i);
                if(ch >= '0' && ch <= '9') {
                    cur.append(ch);
                }else {
                    if(cur.length() > ret.length()) {
                        ret = cur;
                        cur = new StringBuilder();
                    }else {
                        cur = new StringBuilder();
                    }
                }
            }
            if(cur.length() > ret.length()) {
                ret = cur;
            }
            System.out.println(ret);
        }
    }




    /*public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String string = in.nextLine();
            String cur = "";
            String ret = "";
            int i = 0;
            for (; i < string.length(); i++) {
                char ch = string.charAt(i);
                if(ch >= '0' && ch <= '9') {
                    cur = cur + ch + "";
                }else {
                    if(cur.length() > ret.length()) {
                        ret = cur;
                        cur = "";
                    }else {
                        cur = "";
                    }
                }
            }
            if(cur.length() > ret.length()) {
                ret = cur;
            }
            System.out.println(ret);
        }
    }*/
}
